<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
        //symbol唯一
        // let key1 = Symbol('zhangsan')
        // let key2 = Symbol('zhangsan')
      
        // const user = {
        //   [key1]: {name :'hah'},
        //   [key2]:{name:'xiix'},
         
        // };
        // console.log(user);

      //       let key1 = Symbol('张三')
      // let key2 = Symbol('张三')

      // let users = {
      //   [key1]: { age: 18, sex: '男' },
      //   [key2]: { age: 20, sex: '女' },
      // }

      // console.log(users)
      // console.log(users[key2])

      const obj ={
        a:1,
        b:2,
        [Symbol('c')] :3,
        [Symbol('d')]:4,
      }
      for(var k in obj){
        console.log(k)
      }
      console.log(Object.keys(obj))
      console.log(Object.getOwnPropertySymbols(obj))

//       var obj = {
//   a: 1,
//   b: 2,
//   [Symbol('c')]: 3,
//   [Symbol('d')]: 4,
// }

// for (var k in obj) {
//   console.log(k) // 'a' , 'b'
// }
// console.log(Object.getOwnPropertyNames(obj)) // ['a','b']
// console.log(Object.keys(obj)) // ['a','b']
    </script>
  </body>
</html>
